InstitutionalReviewForm=Ext.extend(Ext.Window,{
    constructor:function(a){
    Ext.apply(this,a);
    this.initUIComponents();
        InstitutionalReviewForm.superclass.constructor.call(this,{
            layout:'fit',
            id : "InstitutionalReviewForm",
            items : yearGridFormPanel,
            model:true,
            bodyStyle:'padding:2px;',
            buttonAlign:'center',
            buttons : yearGridFormButtons,
            title : "制度评审信息添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        })
    },
    initUIComponents:function(){
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/securitysystem/saveInstitutionalReview.do",
                items:[
                        {
                            id : "institutionalReview.id",
                            name : "institutionalReview.id",
                            xtype : "hidden",
                            value : this.id == null ? "": this.id
                        }, {
                            name : "institutionalReview.years",
                            xtype : "hidden",
                            id : "institutionalReview.years",
                            value : this.years == null ? "" : this.years
                        }, {
                            layout:'column',
                            bodyStyle:"padding:5px;",
                            border:false,
                            items:[{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                columnWidth:.5,
                                border:false,
                                items:[{
                                    xtype:'combo',
                                    fieldLabel:'所属机构',
                                    hiddenName:'institutionalReview.institution',
                                    mode:'local',
                                    editable:false,
                                    width:146,
                                    triggerAction:'all',
                                    store:new Ext.data.ArrayStore({
                                        id:0,
                                        fields:['id','type'],
                                        data:[ [ "1", "组织部" ],
                                               [ "2", "财务部" ],
                                               [ "3", "销售部" ]]
                                    }),
                                    valueField:'type',
                                    displayField:'type',
                                    value:'销售部'
                                }]
                            },{
                                layout:'column',
                                bodyStyle:'padding:5px;',
                                columnWidth:.5,
                                border:false,
                                items:[{
                                    columnWidth:.7,
                                    layout:"form",
                                    border:false,
                                    items:[{
                                        xtype:"textfield",
                                        width:100,
                                        fieldLabel:'制度编号<font color="red">*</font>',
                                        name:'institutionalReview.institutionalNo',
                                        allowBlank:false,
                                        maxLength:100
                                    }]
                                },{
                                    columnWidth:.3,
                                    layout:"form",
                                    border:false,
                                    items:[{
                                        text:'选择',
                                        width:50,
                                        xtype:'button',
                                        handler:function(){
                                            SingleGridEject.getView({
                                                callback:function(records){
                                                     var institutionalReviewForm=yearGridFormPanel.getForm();
                                                     institutionalReviewForm.findField("institutionalReview.institutionalNo").setValue(records[0].data.instilNo);
                                                },
                                                multiSel:false,
                                                select:true,
                                                winId:'InstitutionalArchivesInfoWin',
                                                winTitle:'制度信息查看',
                                                winWidth:700,
                                                winHeight:480,
                                                winListurl:__ctxPath + "/securitysystem/listInstitutionalArchives.do",
                                                winFields : [ "id", 'years','institution','instilNo', "instiName", "instiDescribe", "instiVersion","taskEffiveTime"],
                                                columnModel : [ {
                                                        header : "id",
                                                        dataIndex : "id",
                                                        hidden : true
                                                    }, {
                                                        header : "年份",
                                                        dataIndex : "years",
                                                        width : 50,
                                                        hidden:true,
                                                        sortable : true
                                                    }, {
                                                        header:"所属机构",
                                                        dataIndex:'institution',
                                                        width:100
                                                    },{
                                                        header : "制度编号",
                                                        dataIndex : "instilNo",
                                                        width : 100
                                                    }, {
                                                        header : "制度名称",
                                                        dataIndex : "instiName",
                                                        width : 70
                                                    }, {
                                                        header : "版本号",
                                                        dataIndex : "instiVersion",
                                                        width : 100
                                                    }, {
                                                        header:"生效时间",
                                                        dataIndex:"taskEffiveTime",
                                                        width:100
                                                    }, {
                                                        header : "制度描述",
                                                        dataIndex : "instiDescribe",
                                                        width : 70
                                                    }]
                                            }).show();
                                        }
                                    }]
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    fieldLabel:'评审项目',
                                    name:'institutionalReview.reviewProject',
                                    width:146,
                                    maxLength:200
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'datefield',
                                    name:'institutionalReview.reviewTime',
                                    fieldLabel:'评审时间',
                                    width:146,
                                    maxLength:100,
                                    format:'y-m-d'
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'institutionalReview.reviewDepartment',
                                    fieldLabel:'评审部门',
                                    width:146,
                                    maxLength:200
                                }]
                            },{
                                layout:'form',
                                bodyStyle:'padding:5px;',
                                border:false,
                                columnWidth:.5,
                                items:[{
                                    xtype:'textfield',
                                    name:'institutionalReview.participatinngPerson',
                                    fieldLabel:'参评人员',
                                    width:146,
                                    maxLength:200
                                }]
                            }]
                        },{
                            layout:'column',
                            bodyStyle:"padding:5px;",
                            border:false,
                            items:[{
                                layout:"form",
                                bodyStyle:"padding:5px;",
                                columnWidth:1.,
                                items:[{
                                xtype:"textarea", 
                                fieldLabel: '评审原因', 
                                name: 'institutionalReview.reviewReason', 
                                width : 448,
                                maxLength:2000
                                }]
                            }]
                        },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:"textarea", 
                               fieldLabel: '评审结论', 
                               name: 'institutionalReview.reviewResult', 
                               width : 448,
                               maxLength:2000
                               }]
                           }]
                       },{
                           layout:'column',
                           bodyStyle:"padding:5px;",
                           border:false,
                           items:[{
                               layout:'form',
                               bodyStyle:"padding:5px;",
                               columnWidth:1.,
                               items:[{
                               xtype:'textarea',
                               fieldLabel:'备注',
                               name:'institutionalReview.remark',
                               width:448,
                               maxLength:1000
                               }]
                           }]
                       }]
            },
            loadData:{
                getUrl:__ctxPath +"/securitysystem/getInstitutionalReview.do",
                preName : "institutionalReview",
                callback:function(obj,formPanel){
                    if(!obj.reviewTime){
                        formPanel.getCmpByName("institutionalReview.reviewTime").setValue(null);
                    }
                }
            }
        });
    }
})